<!DOCTYPE html>
<html lang="zh">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
  <meta name="author" content="yinq">
  <title>后台首页 - {$SystemName}</title>
  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-touch-fullscreen" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="default">
  <link rel="stylesheet" type="text/css" href="/css/materialdesignicons.min.css">
  <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="/css/animate.min.css">
  <link rel="stylesheet" type="text/css" href="/js/bootstrap-multitabs/multitabs.min.css">
  <link rel="stylesheet" type="text/css" href="/css/style.min.css">
  <link rel="stylesheet" type="text/css" href="/js/jquery-confirm/jquery-confirm.min.css">
  <style>
    #logo a {
      font-size: 22px;
      line-height: 68px;
      white-space: nowrap;
      color: #4d5259;
    }

    [data-logobg*='color_'] #logo a {
      color: #fff;
    }

    @media (min-width: 1024px) {
      .lyear-layout-sidebar.lyear-aside-open #logo a {
        display: block;
        width: 47px;
        height: 68px;
        letter-spacing: 3px;
        margin: 0 auto;
        overflow: hidden;
        text-align: center;
      }

      .lyear-layout-sidebar-close .lyear-layout-sidebar:hover #logo a {
        width: 100%;
        margin: 0;
        letter-spacing: 0px;
      }
    }
  </style>
</head>

<body class="lyear-index">
  <div class="lyear-layout-web">
    <div class="lyear-layout-container">
      <!--左侧导航-->
      <aside class="lyear-layout-sidebar">

        <!-- logo -->
        <div id="logo" class="sidebar-header">
          <a href="/">{$SystemName}后台</a>
        </div>
        <div class="lyear-layout-sidebar-info lyear-scroll">

          <nav class="sidebar-main">

            <ul class="nav-drawer">
              <li class="nav-item active">
                <a class="multitabs" href="main.html" id="default-page">
                  <i class="mdi mdi-home-city-outline"></i>
                  <span>后台首页</span>
                </a>
              </li>
              <li class="nav-item">
                <a class="multitabs" href="AuthorizationManagement.html">
                  <i class="mdi mdi-account-key"></i>
                  <span>授权管理</span>
                </a>
              </li>
              <li class="nav-item">
                <a class="multitabs" href="PermissionManagement.html">
                  <i class="mdi mdi-key-alert"></i>
                  <span>权限管理</span>
                </a>
              </li>
              <li class="nav-item">
                <a class="multitabs" href="config.html">
                  <i class="mdi mdi-application-cog"></i>
                  <span>站点配置</span>
                </a>
              </li>
            </ul>
          </nav>

          <div class="sidebar-footer">
            <p class="copyright">
              <span>Copyright &copy; 2024. </span>
              <a target="_blank" href="https://gitee.com/ji_pu">基蒲</a>
              <span> All rights reserved.</span>
            </p>
          </div>
        </div>

      </aside>
      <!--End 左侧导航-->

      <!--头部信息-->
      <header class="lyear-layout-header">

        <nav class="navbar">

          <div class="navbar-left">
            <div class="lyear-aside-toggler">
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
            </div>
          </div>

          <ul class="navbar-right d-flex align-items-center">
            <!--切换主题配色-->
            <li class="dropdown dropdown-skin">
              <span data-bs-toggle="dropdown" class="icon-item">
                <i class="mdi mdi-palette fs-5"></i>
              </span>
              <ul class="dropdown-menu dropdown-menu-end" data-stopPropagation="true">
                <li class="lyear-skin-title">
                  <p>主题</p>
                </li>
                <li class="lyear-skin-li clearfix">
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_1" value="default"
                      checked="checked">
                    <label class="form-check-label" for="site_theme_1"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_2"
                      value="translucent-green">
                    <label class="form-check-label" for="site_theme_2"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_3"
                      value="translucent-blue">
                    <label class="form-check-label" for="site_theme_3"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_4"
                      value="translucent-yellow">
                    <label class="form-check-label" for="site_theme_4"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_5"
                      value="translucent-red">
                    <label class="form-check-label" for="site_theme_5"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_6"
                      value="translucent-pink">
                    <label class="form-check-label" for="site_theme_6"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_7"
                      value="translucent-cyan">
                    <label class="form-check-label" for="site_theme_7"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="site_theme" id="site_theme_8" value="dark">
                    <label class="form-check-label" for="site_theme_8"></label>
                  </div>
                </li>
                <li class="lyear-skin-title">
                  <p>LOGO</p>
                </li>
                <li class="lyear-skin-li clearfix">
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_1" value="default"
                      checked="checked">
                    <label class="form-check-label" for="logo_bg_1"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_2" value="color_2">
                    <label class="form-check-label" for="logo_bg_2"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_3" value="color_3">
                    <label class="form-check-label" for="logo_bg_3"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_4" value="color_4">
                    <label class="form-check-label" for="logo_bg_4"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_5" value="color_5">
                    <label class="form-check-label" for="logo_bg_5"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_6" value="color_6">
                    <label class="form-check-label" for="logo_bg_6"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_7" value="color_7">
                    <label class="form-check-label" for="logo_bg_7"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="logo_bg" id="logo_bg_8" value="color_8">
                    <label class="form-check-label" for="logo_bg_8"></label>
                  </div>
                </li>
                <li class="lyear-skin-title">
                  <p>头部</p>
                </li>
                <li class="lyear-skin-li clearfix">
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_1" value="default"
                      checked="checked">
                    <label class="form-check-label" for="header_bg_1"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_2" value="color_2">
                    <label class="form-check-label" for="header_bg_2"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_3" value="color_3">
                    <label class="form-check-label" for="header_bg_3"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_4" value="color_4">
                    <label class="form-check-label" for="header_bg_4"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_5" value="color_5">
                    <label class="form-check-label" for="header_bg_5"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_6" value="color_6">
                    <label class="form-check-label" for="header_bg_6"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_7" value="color_7">
                    <label class="form-check-label" for="header_bg_7"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="header_bg" id="header_bg_8" value="color_8">
                    <label class="form-check-label" for="header_bg_8"></label>
                  </div>
                </li>
                <li class="lyear-skin-title">
                  <p>侧边栏</p>
                </li>
                <li class="lyear-skin-li clearfix">
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_1" value="default"
                      checked="checked">
                    <label class="form-check-label" for="sidebar_bg_1"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_2" value="color_2">
                    <label class="form-check-label" for="sidebar_bg_2"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_3" value="color_3">
                    <label class="form-check-label" for="sidebar_bg_3"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_4" value="color_4">
                    <label class="form-check-label" for="sidebar_bg_4"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_5" value="color_5">
                    <label class="form-check-label" for="sidebar_bg_5"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_6" value="color_6">
                    <label class="form-check-label" for="sidebar_bg_6"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_7" value="color_7">
                    <label class="form-check-label" for="sidebar_bg_7"></label>
                  </div>
                  <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="sidebar_bg" id="sidebar_bg_8" value="color_8">
                    <label class="form-check-label" for="sidebar_bg_8"></label>
                  </div>
                </li>
              </ul>
            </li>
            <!--End 切换主题配色-->
            <!--个人头像内容-->
            <li class="dropdown">
              <a href="javascript:void(0)" data-bs-toggle="dropdown" class="dropdown-toggle">
                <span style="margin-left: 10px;">管理员</span>
              </a>
              <ul class="dropdown-menu dropdown-menu-end">
                <li>
                  <a class="dropdown-item" id="xgzh" href="javascript:void(0)">
                    <i class="mdi mdi-account"></i>
                    <span>修改账号</span>
                  </a>
                </li>
                <li>
                  <a class="dropdown-item" href="javascript:void(0)" id="xgmm">
                    <i class="mdi mdi-lock-outline"></i>
                    <span>修改密码</span>
                  </a>
                </li>
                <li>
                  <a class="dropdown-item" href="javascript:void(0)"
                    onclick="sessionStorage.clear();location.reload();">
                    <i class="mdi mdi-delete"></i>
                    <span>清空缓存</span>
                  </a>
                </li>
                <li class="dropdown-divider"></li>
                <li>
                  <a class="dropdown-item" href="/admin/login">
                    <i class="mdi mdi-logout-variant"></i>
                    <span>退出登录</span>
                  </a>
                </li>
              </ul>
            </li>
            <!--End 个人头像内容-->
          </ul>

        </nav>

      </header>
      <!--End 头部信息-->

      <!--页面主要内容-->
      <main class="lyear-layout-content">

        <div id="iframe-content"></div>

      </main>
      <!--End 页面主要内容-->
    </div>
  </div>

  <script type="text/javascript" src="/js/jquery.min.js"></script>
  <script type="text/javascript" src="/js/popper.min.js"></script>
  <script type="text/javascript" src="/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
  <script type="text/javascript" src="/js/bootstrap-multitabs/multitabs.min.js"></script>
  <script type="text/javascript" src="/js/jquery.cookie.min.js"></script>
  <script type="text/javascript" src="/js/index.min.js"></script>
  <script type="text/javascript" src="/js/lyear-loading.js"></script>
  <script type="text/javascript" src="/js/jquery-confirm/jquery-confirm.min.js"></script>
  <script type="text/javascript" src="/js/bootstrap-notify.min.js"></script>
  <script type="text/javascript" src="/js/main.min.js"></script>
  <script type="text/javascript">
    $(document).ready(function (e) {
      $('#xgzh').on('click', function () {
        $.confirm({
          title: '修改账号',
          //content: 'url:form.html',  // 也可以采用url形式
          content: '<div class="form-group p-1 mb-0">' +
            '  <label class="control-label">账号</label>' +
            '  <input autofocus="" type="text" id="input-username" placeholder="请输入您的新用户名" class="form-control">' +
            '</div>',
          buttons: {
            sayMyName: {
              text: '保存',
              btnClass: 'btn-orange',
              action: function () {
                var input = this.$content.find('input#input-username');
                var l = $('.jconfirm-box').lyearloading({
                  opacity: 0.1,
                  backgroundColor: '#ccc',
                  textColorClass: 'text-success',
                  spinnerColorClass: 'text-success',
                  spinnerSize: 'lg',
                  zindex: 9999,
                });
                $.ajax({
                  type: "post",
                  url: "?action=setUsername",
                  dataType: "json",
                  data: {
                    username: input.val()
                  },
                  success: function (data) {
                    l.hide();
                    if (data.code) {
                      notify("新用户名", data.msg, 'success');
                      setTimeout(function () {
                        location.reload();
                      }, 3000);
                    } else {
                      notify("新用户名", data.msg, 'error');
                    }
                  },
                  error: function (data) {
                    l.hide();
                    notify("错误", "请求失败", 'error');
                  }
                })
                return false;
              }
            },
            '稍等': function () { }
          }
        });
      });
      $('#xgmm').on('click', function () {
        $.confirm({
          title: '修改密码',
          //content: 'url:form.html',  // 也可以采用url形式
          content: '<div class="form-group p-1 mb-0">' +
            '  <label class="control-label">密码</label>' +
            '  <input autofocus="" type="text" id="input-password" placeholder="请输入您的新密码" class="form-control">' +
            '</div>',
          buttons: {
            sayMyName: {
              text: '保存',
              btnClass: 'btn-orange',
              action: function () {
                var input = this.$content.find('input#input-password');
                var l = $('.jconfirm-box').lyearloading({
                  opacity: 0.1,
                  backgroundColor: '#ccc',
                  textColorClass: 'text-success',
                  spinnerColorClass: 'text-success',
                  spinnerSize: 'lg',
                  zindex: 9999,
                });
                $.ajax({
                  type: "post",
                  url: "?action=setPassword",
                  dataType: "json",
                  data: {
                    password: input.val()
                  },
                  success: function (data) {
                    l.hide();
                    if (data.code) {
                      notify("新密码", data.msg, 'success');
                      setTimeout(function () {
                        location.reload();
                      }, 3000);
                    } else {
                      notify("新密码", data.msg, 'error');
                    }
                  },
                  error: function (data) {
                    l.hide();
                    notify("错误", "请求失败", 'error');
                  }
                })
                return false;
              }
            },
            '稍等': function () { }
          }
        });
      });
    });
    function notify(title, message, type) {
      if (window.parent && window.parent !== window) if (typeof window.parent.notify === 'function') return window.parent.notify(title, message, type);
      if (typeof $.notify != 'function') return;
      switch (type) {
        case 'success':
          icon = "mdi mdi-check-all"
          type = 'success';
          break;
        case 'warning':
          icon = "mdi mdi-alert-circle"
          type = 'warning';
          break;
        case 'error':
          icon = "mdi mdi-close-octagon-outline"
          type = 'danger';
          break;
        default:
          icon = "mdi mdi-information-outline"
          type = 'info';
      }
      $.notify({
        icon: 'mdi mdi-alert',
        title,
        message,
        url: '',
        target: '_blank'
      }, {
        type,
        allow_dismiss: true,
        newest_on_top: true,
        placement: {
          from: 'top',
          align: 'right'
        },
        offset: {
          x: 20,
          y: 20
        },
        spacing: 10,
        z_index: 1031,
        delay: 3000,
        animate: {
          enter: 'animate__animated animate__fadeInDown',
          exit: 'animate__animated animate__fadeOutRight'
        },
      });
    }
  </script>
</body>

</html>